package newWorldxxxTP02;

public abstract class LivingBeing implements LivingBeingInterface
{
	/**
     *  Constructeur par d&eacute;faut qui initialise l'id de 
     * chaque &ecirc;tre vivant.
     *
     */
    public LivingBeing(long d) {
    	dateOfBirth=d;
    	id=idGenerator++;
    }
    
    /* (non-Javadoc)
	 * @see newWorldxxTP01.LivingBeingInterface#getDateOfBirth()
	 */
    public long getDateOfBirth(){return dateOfBirth;}
    private long dateOfBirth;
    
    /* (non-Javadoc)
	 * @see newWorldxxTP01.LivingBeingInterface#getId()
	 */
    public int getId(){return id;}
    private int id;
    
    /**
     * Cette variable sert � assignier � chaque
     * �tre vivant un num�ro unique.
     */
    static private int idGenerator=0;
    
    public String toString() {
    	return "id : "+id+" date of birth : "+dateOfBirth;
    }
}
